package com.zy.recursion;

/**
 * @description: 递归栈调用演示
 * @author: zhaoyi
 * @create: 2019-08-19 22:57
 * https://leetcode-cn.com/explore/orignial/card/recursion-i/256/principle-of-recursion/1101/
 **/

public class Recursion {

    /**
     * 递归调用
     *
     * @param i 递归次数
     */
    public void test(int i) {
        if (i > 1) {
            test(i - 1);
        }
        System.out.println("i= " + i);
    }

    public int test2(int i) {
        if (i > 1) {
            return test2(i - 1);
        }
        System.out.println("i= " + i);
        return i;
    }

}
